package cn.wh.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: wh
 * @create: 2022-09-09 17:20
 * @description
 **/
public class UserDao {
    private static Map<String,String> hashMap=new HashMap<>();

    static {
        hashMap.put("10001", "小傅哥");
        hashMap.put("10002", "八杯水");
        hashMap.put("10003", "阿毛");
    }
    public String queryUserName(String uId){
        return hashMap.get(uId);
    }


    public void initDataMethod(){
        System.out.println("执行：init-method");
        hashMap.put("10001", "小傅哥");
        hashMap.put("10002", "八杯水");
        hashMap.put("10003", "阿毛");
    }

    public void destroyDataMethod(){
        System.out.println("执行：destroy-method");
        hashMap.clear();
    }

}
